#pragma once

inline unsigned char reverse(unsigned char c)
{
	static unsigned char s_reverseTable[16] =
	{
		0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F
	};

	unsigned char r = 0;

	r |= (s_reverseTable[c&0xF]) << 4;
	r |= s_reverseTable[c >> 4];

	return r;
}
